# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

pkgname=libpciaccess
pkgver=0.17
pkgrel=1
pkgdesc="X11 PCI access library"
arch=(x86_64)
license=('custom')
url="https://xorg.freedesktop.org/"
depends=('glibc' 'zlib')
makedepends=('xorg-util-macros' 'meson')
source=(${url}/releases/individual/lib/${pkgname}-${pkgver}.tar.xz{,.sig})
sha512sums=('8484605c66ef18c8d8a3e029a6d33e26fcaa450c1263790d89ac8b0a160ffb2dfceaa6140ac9ad7d8087283ecbec8ac801f757e44890d547c3cbecd2c922ca47'
            'SKIP')
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>
#validpgpkeys+=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D') # "Emil Velikov <emil.l.velikov@gmail.com>" 
#validpgpkeys+=('995ED5C8A6138EB0961F18474C09DD83CAAA50B2') # "Adam Jackson <ajax@nwnk.net>"

prepare() {
  mkdir build
}

build() {
  arch-meson "$pkgname"-$pkgver build
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 "$pkgname"-$pkgver/COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}/"
}
